package pta.newch04.ex03;
import java.util.Arrays;
import java.util.Scanner;

public class Main {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        Rectangle[] rectangles = new Rectangle[2];
        for (int i = 0; i < 2; i++) {
            int width = scanner.nextInt();
            int length = scanner.nextInt();
            rectangles[i] = new Rectangle(width, length);
        }
        Circle[] circles = new Circle[2];
        for (int i = 0; i < 2; i++) {
            int radius = scanner.nextInt();
            circles[i] = new Circle(radius);
        }
        int totalPerimeter = 0;
        int totalArea = 0;
        for (Rectangle rect : rectangles) {
            totalPerimeter += rect.getPerimeter();
            totalArea += rect.getArea();
        }
        for (Circle circle : circles) {
            totalPerimeter += circle.getPerimeter();
            totalArea += circle.getArea();
        }
        System.out.println(totalPerimeter);
        System.out.println(totalArea);
        System.out.println(Arrays.deepToString(rectangles));
        System.out.println(Arrays.deepToString(circles));
    }
}
class Rectangle {
    private int width;
    private int length;
    public Rectangle(int width, int length) {
        this.width = width;
        this.length = length;
    }
    public int getPerimeter() {
        return 2 * (width + length);
    }
    public int getArea() {
        return width * length;
    }
    @Override
    public String toString() {
        return "Rectangle [width=" + width + ", length=" + length + "]";
    }
}
class Circle {
    private int radius;

    public Circle(int radius) {
        this.radius = radius;
    }
    public int getPerimeter() {
        return (int)(2 * Math.PI * radius);
    }
    public int getArea() {
        return (int)(Math.PI * radius * radius);
    }
    @Override
    public String toString() {
        return "Circle [radius=" + radius + "]";
    }
}
